<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BUIFormButton
 *
 * @author I062261
 */
class BUIFormButton extends BUIButton {

    //put your code here

    public function getData($data = NULL) {
        $buttonId = Blyn::app()->getCurrentNode()->getUIManager()->getCurrentScreen()->getId(). "_". $this->getName();
        $options = NULL;
        
        if (is_array($data))
            $this->data = array_merge($this->data, $data);

        if (isset($this->data['button']['htmlOptions'])) {
            $options = $this->data['button']['htmlOptions'];
        }

        if (!is_array($options))
            $options = array();

        $options['name'] = $buttonId;
        $this->data['button']['htmlOptions'] = $options;


        //return parent::getData();
    }

    public function isClicked() {

        $buttonId = Blyn::app()->getCurrentNode()->getUIManager()->getCurrentScreen()->getId(). "_". $this->getName();        

        if (isset($_POST[$buttonId]))
            return TRUE;

        return FALSE;
    }

}

?>
